/// distance : {"value":"630.30","unit":"米"}
/// speed : {"value":"4.68","unit":"千米/小时"}
/// kcal : {"value":"86.17","unit":"KCal"}
/// duration : {"day":0,"hour":0,"minute":13,"seconds":32,"timeStr":null}

class RunSummaryModel {
  RunSummaryModel({
      Distance? distance, 
      Speed? speed, 
      Kcal? kcal, 
      XDuration? duration,}){
    _distance = distance;
    _speed = speed;
    _kcal = kcal;
    _duration = duration;
}

  RunSummaryModel.fromJson(dynamic json) {
    _distance = json['distance'] != null ? Distance.fromJson(json['distance']) : null;
    _speed = json['speed'] != null ? Speed.fromJson(json['speed']) : null;
    _kcal = json['kcal'] != null ? Kcal.fromJson(json['kcal']) : null;
    _duration = json['duration'] != null ? XDuration.fromJson(json['duration']) : null;
  }
  Distance? _distance;
  Speed? _speed;
  Kcal? _kcal;
  XDuration? _duration;
RunSummaryModel copyWith({  Distance? distance,
  Speed? speed,
  Kcal? kcal,
  XDuration? duration,
}) => RunSummaryModel(  distance: distance ?? _distance,
  speed: speed ?? _speed,
  kcal: kcal ?? _kcal,
  duration: duration ?? _duration,
);
  Distance? get distance => _distance;
  Speed? get speed => _speed;
  Kcal? get kcal => _kcal;
  XDuration? get duration => _duration;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_distance != null) {
      map['distance'] = _distance?.toJson();
    }
    if (_speed != null) {
      map['speed'] = _speed?.toJson();
    }
    if (_kcal != null) {
      map['kcal'] = _kcal?.toJson();
    }
    if (_duration != null) {
      map['duration'] = _duration?.toJson();
    }
    return map;
  }

}

/// day : 0
/// hour : 0
/// minute : 13
/// seconds : 32
/// timeStr : null

class XDuration {
  XDuration({
      num? day, 
      num? hour, 
      num? minute, 
      num? seconds, 
      dynamic timeStr,}){
    _day = day;
    _hour = hour;
    _minute = minute;
    _seconds = seconds;
    _timeStr = timeStr;
}

  XDuration.fromJson(dynamic json) {
    _day = json['day'];
    _hour = json['hour'];
    _minute = json['minute'];
    _seconds = json['seconds'];
    _timeStr = json['timeStr'];
  }
  num? _day;
  num? _hour;
  num? _minute;
  num? _seconds;
  dynamic _timeStr;
XDuration copyWith({  num? day,
  num? hour,
  num? minute,
  num? seconds,
  dynamic timeStr,
}) => XDuration(  day: day ?? _day,
  hour: hour ?? _hour,
  minute: minute ?? _minute,
  seconds: seconds ?? _seconds,
  timeStr: timeStr ?? _timeStr,
);
  num? get day => _day;
  num? get hour => _hour;
  num? get minute => _minute;
  num? get seconds => _seconds;
  dynamic get timeStr => _timeStr;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['day'] = _day;
    map['hour'] = _hour;
    map['minute'] = _minute;
    map['seconds'] = _seconds;
    map['timeStr'] = _timeStr;
    return map;
  }

}

/// value : "86.17"
/// unit : "KCal"

class Kcal {
  Kcal({
      String? value, 
      String? unit,}){
    _value = value;
    _unit = unit;
}

  Kcal.fromJson(dynamic json) {
    _value = json['value'];
    _unit = json['unit'];
  }
  String? _value;
  String? _unit;
Kcal copyWith({  String? value,
  String? unit,
}) => Kcal(  value: value ?? _value,
  unit: unit ?? _unit,
);
  String? get value => _value;
  String? get unit => _unit;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['value'] = _value;
    map['unit'] = _unit;
    return map;
  }

}

/// value : "4.68"
/// unit : "千米/小时"

class Speed {
  Speed({
      String? value, 
      String? unit,}){
    _value = value;
    _unit = unit;
}

  Speed.fromJson(dynamic json) {
    _value = json['value'];
    _unit = json['unit'];
  }
  String? _value;
  String? _unit;
Speed copyWith({  String? value,
  String? unit,
}) => Speed(  value: value ?? _value,
  unit: unit ?? _unit,
);
  String? get value => _value;
  String? get unit => _unit;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['value'] = _value;
    map['unit'] = _unit;
    return map;
  }

}

/// value : "630.30"
/// unit : "米"

class Distance {
  Distance({
      String? value, 
      String? unit,}){
    _value = value;
    _unit = unit;
}

  Distance.fromJson(dynamic json) {
    _value = json['value'];
    _unit = json['unit'];
  }
  String? _value;
  String? _unit;
Distance copyWith({  String? value,
  String? unit,
}) => Distance(  value: value ?? _value,
  unit: unit ?? _unit,
);
  String? get value => _value;
  String? get unit => _unit;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['value'] = _value;
    map['unit'] = _unit;
    return map;
  }

}